﻿@using YL.Core.Dto
@model string
@{
    var menus = ViewData["menu"] as List<PermissionMenu>;
}
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
    <section class="sidebar">

        <!-- Sidebar user panel -->


        <!-- search form -->

        <!-- /.search form -->
        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu" data-widget="tree">

            @{ if (menus.Count > 0)
                {
                    foreach (var item in menus)
                    {
                        if (item.MenuType == "firstmenu")
                        {
                            <li ref="@item.Url?.Replace("/","")">
                                <a href="@item.Url"><i class="@item.Icon"></i>@item.Name</a>
                            </li>
                        }
                        else
                        {
                            <li class="treeview">
                                <a href="javascript:;">
                                    <i class="@item.Icon"></i>
                                    <span>@item.Name</span>
                                    <span class="pull-right-container">
                                        <i class="fa fa-angle-left pull-right"></i>
                                    </span>
                                </a>
                                <ul class="treeview-menu active">
                                    @foreach (var item2 in item.Children)
                                    {
                                        <li ref="@item2.Url?.Replace("/","")"><a href="@item2.Url"><i class="@item2.Icon"></i> @item2.Name</a></li>
                                    }
                                </ul>
                            </li>
                        }

                    }
                }
            }
        </ul>
    </section>
</aside>